Abstraction and Variation
نویسنده
چکیده
M aster, a friend told me today that I should never use the editor's copy-paste functions when programming , " said the young apprentice. " I thought the whole point of programming tools was to make our lives easier, " he continued. The Master stroked his long grey beard and pressed the busy button on his phone. This was going to be one of those long, important discussions. " Why do you think copy-pasting is wrong? " asked the Master. " Because I violate the DRY [don't repeat yourself] princi-ple? " replied the apprentice hesitantly. 1 " Exactly true, my young friend, " nodded the Master. " But it's so much easier to copy-paste code than to grapple with the alternatives, " continued the apprentice. The Master turned to his keyboard and typed " copy paste miner " in a search box. His memory was rapidly deteriorating, but luckily he could compensate by applying his formidable search skills on Google's planet-wide memory. He read aloud some key sentences from an article's abstract: 2 " CP-Miner uses data-mining techniques to efficiently identify copy-pasted code in large software suites and detects copy-paste bugs. Specifically, it takes less than 20 minutes for CP-Miner to identify 190,000 copy-pasted segments in Linux and 150,000 in FreeBSD. Moreover, CP-Miner has detected many new bugs in popular operating systems, 49 in Linux and 31 in FreeBSD. " The Master looked up from his screen, " Now that you've seen evidence of the extent and dangers of copy-pasting, let me ask you, are you sure you know all the appropriate alternatives? " " Of course I know them, " replied the disciple cockily. " Let's see. How do you handle two identical code sequences? " " I wrap the code up in a function or method. " " And if these functions are to execute subtly different code? " " Then I'll factor out the differences through Boolean or enumeration parameters I pass to them. I'll set the code in the function to follow different execution paths, based on these parameters. " " And if the differences concern data embedded in code? " " That's trivial; I'll simply pass those varying elements as parameters. " The Master was busily jotting down the ap-prentice's answers and his own ideas in a table (see table 1). He continued firing off questions. " And if the differences lie in the types …
منابع مشابه
Abstraction, desalination and recharge method to control seawater intrusion into unconfined coastal aquifers
In this study, abstraction, desalination and recharge method and SEAWAT numerical model are used to investigate seawater intrusion repulsion in a hypothetical two-dimensional coastal aquifer to understand the relation of seawater intrusion with abstraction, desalination and recharge parameters (i.e. abstraction/recharge rate, wells distance and depth). Abstraction, desalination and recharge con...
متن کاملارزیابی رابطه SCS در تعیین تلفات اولیه باران در حوضه های آبریز
The main scope of this research is evaluation of Soil Conservation Service Procedure in derivation of initial abstraction of precipitation in watershed scale. For this purpose Dalaki watershed which is located in south east of Iran was selected then by using hec-hms and GIS models and a number of observed rainfall runoff events some parameters like CN of watershed ,K and X of Muskingam meth...
متن کاملVideo Abstraction in H.264/AVC Compressed Domain
Video abstraction allows searching, browsing and evaluating videos only by accessing the useful contents. Most of the studies are using pixel domain, which requires the decoding process and needs more time and process consuming than compressed domain video abstraction. In this paper, we present a new video abstraction method in H.264/AVC compressed domain, AVAIF. The method is based on the norm...
متن کاملHydrogen Abstraction Reaction of Hydroxyl Radical with 1,1-Dibromoethane and 1,2-Dibromoethane Studied by Using Semi-Classical Transition State Theory
The hydrogen abstraction reaction by OH radical from CH2BrCH2Br (R1) and CH₃CHBr2 (R2) is investigated theoretically by semi-classical transition state theory. The stationary points for both reactions are located by using ωB97X-D and KMLYP density functional methods along with cc-pVTZ basis. Single-point energy calculations are performed at the QCISD(T) and CCSD(T) levels of theory with differe...
متن کاملDynamic manipulation schemes of geometrical constructions: Instrumental genesis as an abstraction process
Dynamic manipulation of geometrical constructions enabled by a specially designed computational tool, called variation tool, is studied during the implementation of proportional geometric tasks in the classroom. The analysis combined the use of two theoretical frameworks: instrumental genesis and situated abstraction. The Dynamic Manipulation Schemes (DMS) developed by 13-year-old students base...
متن کاملAb Initio Theoretical Studies on the Kinetics of the Hydrogen Abstraction Reaction of Hydroxyl Radical with CH3CH2OCF2CHF2 (HFE-374pc2)
The hydrogen abstraction reaction of OH radical with CH3CH2OCF2CHF2 (HFE-374pc2) is investigated theoretically by semi-classical transition state theory. The stationary points on the potential energy surface of the reaction are located by using KMLYP density functional method along with 6-311++G(d,p) basis set. Vibrational anharmonicity coefficients, ...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید
ثبت ناماگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید
ورودعنوان ژورنال:
- IEEE Software
دوره 24 شماره
صفحات -
تاریخ انتشار 2007